<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:template match="/">
    <table style="background-color:green;border-collapse:collapse;border:1px solid green;width:100%;text-align:center;">
      <tr style="color:white;width:100%;">
      	<td style="text-align:center;width:10%;"><b>time \ day</b></td>
        <td style="text-align:center;width:12%;"><b>Sunday</b></td>
        <td style="text-align:center;width:12%;"><b>Monday</b></td>
        <td style="text-align:center;width:12%;"><b>Tuesday</b></td>
        <td style="text-align:center;width:12%;"><b>Wednesday</b></td>
        <td style="text-align:center;width:12%;"><b>Thursday</b></td>
        <td style="text-align:center;width:12%;"><b>Friday</b></td>
        <td style="text-align:center;width:12%;"><b>Saturday</b></td>
      </tr>
      <xsl:for-each select="/timetable/table/line">
      <tr>
      	 <td style="background-color:green;height:3%;color:white;text-align:center;">
      	 	<b><xsl:value-of select="time"/></b>
      	 </td>
      	 <xsl:for-each select="cell">
      	    <xsl:choose>
			    <xsl:when test="duration &lt; 1">
			    	<td style="background-color:white;border:1px solid green;vertical-align:middle;text-align:center;"></td>
			    </xsl:when>
			    <xsl:otherwise>
		        	<td rowspan="{./duration}" style="background-color:white;color:green;border:1px solid green;height:3%;vertical-align:middle;text-align:center;">
		        			<b><xsl:value-of select="courseName"/></b>
		        	</td>
	        	</xsl:otherwise>
        	</xsl:choose>
         </xsl:for-each>
      </tr>
      </xsl:for-each>
    </table>
    <a href="#" onclick="loadPage('student/timetable.jsp?num=1');"> detailed view </a>
	</xsl:template>
</xsl:stylesheet>